import React, {Component} from 'react';
import ComponentInput from './componentInput';
import ComponentList from './componentList';
import './index.css';

export default class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            detail: []
        }
    }

    handleSubmitComment (comment) {
        this.state.detail.push(comment);
        this.setState({
            detail: this.state.detail
        })
    }

    render() {
        return(
            <div className="wrapper">
                <ComponentInput onClick={this.handleSubmitComment.bind(this)} />
                <ComponentList detail={this.state.detail} />
            </div>
        )
    }
}